{extend name="common/application" /}
{block name="title"}
<title>人才培训-更多人才</title>
{/block}
{block name="css"}
<link rel="stylesheet" type="text/css" href="_CSS_/train.css" />
<script src="//api.html5media.info/1.2.2/html5media.min.js"></script>
<!--[if lt IE 9]>
<script src="http://www.ijquery.cn/js/html5shiv.js"></script>
<![endif]-->
{/block}

{block name="navbar"}{include file="/common/navbar" /}{/block}
{block name="content"}

			<!-- 主体内容 -->
			<div class="main">
				<div class="mainBody normalBox clearfix" style="padding-top: 0px;">
					<!--面包屑导航-->
					<div class="breadcrumb">
						<p>当前位置：
							<a href="index.html">人才培训</a> &gt;
							<a class="curPage" href="javascript:;">精英·人才</a>
						</p>
					</div>
					<!--更多人才-->
					<div class="personnels sectionArea normalBox" style="margin-top: 0px;">
						<!--人才分类-->
						<div class="courseMenu">
							<div class="courseType">
								<ul>
									<li>
										<a class="courseTypeItem active" href="javascript:;">
											<span class="icons icon-person01 hide"></span>
											<span class="icons icon-person01-active"></span>全部人才
										</a>
									</li>
									<li>
										<a class="courseTypeItem" href="javascript:;">
											<span class="icons icon-person02"></span>
											<span class="icons icon-person02-active hide"></span>企业管理人才
										</a>
									</li>
									<li>
										<a class="courseTypeItem" href="javascript:;">
											<span class="icons icon-person03"></span>
											<span class="icons icon-person03-active hide"></span>服务业人才
										</a>
									</li>
									<li class="mr0">
										<a class="courseTypeItem" href="javascript:;">
											<span class="icons icon-person04"></span>
											<span class="icons icon-person04-active hide"></span>高层次人才
										</a>
									</li>
								</ul>
							</div>
							<div class="personSelect normalBox clearfix">
								<!--省份选择-->
								<div class="citySelect fr">
									<label for="city">选择省份：</label>
									<select name="city" id="city">
										<option value="0">请选择</option>

									</select>
								</div>
								<!--工作单位-->
								<div class="jobSelect fl">
									<label for="job">工作单位：</label>
									<input class="fillJob" type="text" value="" placeholder="请输入工作单位" name="job"/>
									<input type="button" value="确定">
								</div>
							</div>
						</div>
						<div class="conBody" style="min-height: 500px;">
							<!--查询不出数据-->

						</div>
						<!--分页-->
						<div id="page"></div>
						<!--<div class="pagination" id="pagination">-->
							<!--<a href="javascript:;" class="page-prev">-->
								<!--<span class="icons icon-backward"></span>-->
							<!--</a>-->
							<!--<a href="javascript:;" class="current">1</a>-->
							<!--<a href="javascript:;">2</a>-->
							<!--<a href="javascript:;">3</a>-->
							<!--<a href="javascript:;">4</a>-->
							<!--<a href="javascript:;">5</a>-->
							<!--<a href="javascript:;" class="more" style="background:#f3f3f3 !important;">...</a>-->
							<!--<a href="javascript:;">13</a>-->
							<!--<a href="javascript:;" class="page-next">-->
								<!--<span class="icons icon-forward"></span>-->
							<!--</a>-->
						<!--</div>-->
					</div>
				</div>
			</div>
{/block}


{block name="js"}
		<script type="text/javascript">
			$(function(){
				talent_list(1);
				$.ajax({
					type: "get",
					url: "/index.php/api/talent/province",
					dataType: 'jsonp',
					success: function (msg) {
						if(msg.code == 200){
							var html="";
							for(var i=0;i<msg.data.provice.length;i++){
								html +='<option value="'+msg.data.provice[i].id+'">'+msg.data.provice[i].province+'</option>';
							}
							$("#city").append(html);
						}
					}
				})
			});
			$("#city").on('change',function(){
				talent_list(1);
			});

         
			$('.courseTypeItem').on('click',function(){
				$('.courseTypeItem').removeClass('active');
				$('.courseTypeItem').find("span:eq(0)").removeClass('hide');
				$('.courseTypeItem').find("span:eq(1)").addClass('hide');
				$(this).addClass('active');
				$(this).find("span:eq(0)").addClass('hide');
				$(this).find("span:eq(1)").removeClass('hide');
				talent_list(1);
			});
			$("input[type='button']").on('click',function(){
				talent_list(1);
			});
			function talent_list(page){
				var type = $('.courseType').find("ul li a").index($(".courseTypeItem[class*='active']"));
				var workplace=$(".fillJob").val();
				var province=$("#city").val();
				$.ajax({
					type: "get",
					url: "/index.php/api/talent/talent_index",
					data:{'sheet':1,'number':18,'status':1,"talentrole":type,'page':page,'work':workplace,'area':province},
					dataType: 'jsonp',
					success: function (msg) {
						var html="";
						var re = /^[0-9]+$/;
						if (msg.code == 200) {
							var len = msg.data.data.length;
							if (len == 0) {
								html += '<div class="nodatas normalBox"><img src="/static/web/images/nodata.png"/><p>抱歉，找不到相关数据</p></div>';
							} else {
								for(var i=0;i<len;i++){
									var arr=msg.data.data[i].label.split(" ");
									var label="";
									for(var m=0;m<arr.length;m++){
										if(arr[m]){
											label+='<span class="labels">'+arr[m]+'</span>';
										}
									}
									if(re.test((i+1)/3)){
										html +='<div class="personInfo sectionItem mr0"><div class="userImg">';
									}else{
										html +='<div class="personInfo sectionItem"><div class="userImg">';
									}
									html+='<a class="links" href="persons_details.html?type=1&id='+msg.data.data[i].id+'">';
									html+='<img src="/static/web/images/76.png" class="icon-wapper">';
									html+='<img src="/Images/Talent/'+msg.data.data[i].img_url+'" class="icon"></a></div>';
									html+='<a class="links username" href="persons_details.html?type=1&id='+msg.data.data[i].id+'">'+msg.data.data[i].talentname+'</a>';
									html+='<p class="position">'+msg.data.data[i].rolename+'</p>';
									html+='<p class="position">'+label+'</p>';
									html+='<div class="areas moreline" limit="54">'+msg.data.data[i].field.substring(0,54)+'</div></div>';
								}

							}
							$('.conBody').html(html);
							$('#page').html(msg.data.render);
							$("#pagination").delegate("a","click",function(){
								var num= $(this).attr("num");
								if(num){
									talent_list(num);
								}
							});
						}
					}
				})
			}
		</script>
{/block}
